[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
++ Increment Operator (postfix and prefix)
lvalue++ postfix increment
++lvalue prefix increment
lvalue any variable of type int, float, char, enum,
or related type
The unary postfix operator ++ increments (adds one to) lvalue after the
expression containing lvalue has been evaluated. For example:
j = 10; i = 5 * j++; # i == 50, j == 11
The unary prefix operator ++ increments lvalue before the expression
containing lvalue has been evaluated. For example:
j = 10; i = 5 * ++j; # i == 55, j == 11
-- Decrement Operator (prefix and postfix)
value-- postfix decrement
--value prefix decrement
value any variable of type int, float, char, enum,
or related type
The unary postfix operator -- decrements (subtracts one from ) lvalue
after the expression containing lvalue has been evaluated. For
example:
j = 10; i = 5 * j--; # i == 50, j == 9
The unary prefix operator -- decrements lvalue before the expression
containing lvalue has been evaluated. For example:
j = 10; i = 5 * --j; # i == 45, j == 9
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson